package sk.uniza.fri.cerviix.client.network.message.client;

import java.io.IOException;

import sk.uniza.fri.cerviix.client.network.ClientMessage;
import sk.uniza.fri.cerviix.client.network.MessageType;

public class WormDirectionMessage extends ClientMessage
{
	public Direction direction;
	
	public WormDirectionMessage(Direction direction)
	{
		this.direction = direction;
	}
	
	@Override
	public void send() throws IOException
	{
		setHeader(MessageType.WORM_DIRECTION);
		
		stream.writeByte(direction.value);
	}
	
	public enum Direction
	{
		LEFT(-1),
		STRAIGHT(0),
		RIGHT(1);
		
		public byte value;
		
		private Direction(int value)
		{
			this.value = (byte)value;
		}
	}
}
